import React from 'react'
import Son from './component/son'
import { Provider} from './context'
export default class App extends React.Component {
  constructor(){
     super();
     this.state={
        msg:'这是父亲'
     }
  }
  changeMsg=(msg)=>{
      return ()=>{
          this.setState({
            msg
          })
      }
  }
  render() {
    return (
      <Provider value={{...this.state,changeMsg:this.changeMsg}}>
        <div>
          <h1>{this.state.msg}</h1>
          <Son />
        </div>
      </Provider>
    )
  }
}